package com.nkzy.models;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.Data;

@Data
public class PageQuery {

    private Integer pageNum;
    private Integer pageSize;

    public <T> Page<T> build() {

        Integer page = pageNum;
        Integer size = pageSize;
        if (page == null) {
            page = 1;
        }
        if (size == null) {
            size = Integer.MAX_VALUE;
        }

        return  new Page<>(page, size);

    }

}
